<?php
defined('_JEXEC') or die('Restricted access');

jimport('joomla.application.component.view');
class JoomdietViewEditVariable extends JView
{
    function display($tpl=null) {
        // loading common toolbar
        JToolBarHelper::save();
        JToolBarHelper::back();
        
        $cid = JRequest::getVar('cid');
        
        // loading specific title
        if ($cid) {
            JToolBarHelper::title(JText::_('COM_JOOMDIET_VARIABLE_EDITOR_TITLE'));
        } else {
            JToolBarHelper::title(JText::_('COM_JOOMDIET_VARIABLE_ADD_TITLE'));
        }
        
        $model =& $this->getModel();
        $row =& $this->get('Variable');
        $infant =& $this->get('Infant');
        $children =& $this->get('Children');
        $men =& $this->get('Men');
        $women =& $this->get('Women');
        $gestation =& $this->get('Gestation');
        $lactation =& $this->get('Lactation');
        
        //loading needed form data
        $this->assignRef('row', $row);
        $this->assignRef('infant', $infant);
        $this->assignRef('children', $children);
        $this->assignRef('men', $men);
        $this->assignRef('women', $women);
        $this->assignRef('gestation', $gestation);
        $this->assignRef('lactation', $lactation);
    
        parent::display($tpl);
    }
}
?>
